package com.wealth.lottery.repository;

import iaas.repository.BaseRepository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import com.wealth.lottery.entity.LotteryActivity;
/**
 * LotteryActivityDao
 * @author lihang 2016-06-27
 *
 */
@Repository
public interface LotteryActivityDao extends BaseRepository<LotteryActivity, Long>,JpaSpecificationExecutor<LotteryActivity>{
	
	/**
	 * 查询该企业下 正在启用的抽奖活动
	 */
	List<LotteryActivity> findByStatusAndCorpIdAndType(int status,Long corpid,int type); 

	/**
	 * 查询该企业下所有启用的活动
	 */
	List<LotteryActivity> findByCorpIdAndStatus(Long corpid,Integer status) throws Exception;

	List<LotteryActivity> findByCorpIdAndStatusAndType(Long corpid,Integer status,Integer type) throws Exception;
	
	/**查询所有的抽奖活动*/
	List<LotteryActivity> findByStatus(int status);
	/**查询所有的抽奖活动*/
	List<LotteryActivity> findByStatusNot(int status);
	/**查询不扫外码的抽经活动*/
	List<LotteryActivity> findByCorpIdAndStatusAndScoretype(Long corpid,int status,int scoretype);
	List<LotteryActivity> findByCorpIdAndStatusNotAndScoretype(Long corpid,int status,int scoretype);
	
	
	List<LotteryActivity> findByCorpIdAndStatusAndScoreLessThanEqual(Long corpid,Integer status,Double money);
	
	
	

}
